package com.sc.nft.service.impl;

import com.sc.nft.dao.MenuDao;
import com.sc.nft.entity.Menu;
import com.sc.nft.service.MenuService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 系统菜单表服务接口实现
 *
 * @author zhangxiangyu
 * @since 2022-02-02 17:11:19
 * @description 
 */
@Slf4j
@RequiredArgsConstructor
@Service
public class MenuServiceImpl implements MenuService {
    private final MenuDao menuDao;

    @Override
    public List<Menu> getMenu(Long roleId) {
        if(roleId==null){
            return menuDao.queryAllMenu();
        }else{
            return menuDao.queryMenu(roleId);
        }
    }

}